package com.zy.openchat.core.model.circle;

import android.os.Parcel;
import android.os.Parcelable;

public class BlogUserInfo implements Parcelable {

    // blogs: int, 动态数量
    // follows: int, 关注数量
    // fans: int, 粉丝数量
    // likes: 获赞数量
    // followed: bool, 是否已关注

    public long user_id;
    public int blogs;
    public int follows;
    public int fans;
    public int likes;
    public boolean followed;


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(this.user_id);
        dest.writeInt(this.blogs);
        dest.writeInt(this.follows);
        dest.writeInt(this.fans);
        dest.writeInt(this.likes);
        dest.writeByte(this.followed ? (byte) 1 : (byte) 0);
    }

    public void readFromParcel(Parcel source) {
        this.user_id = source.readLong();
        this.blogs = source.readInt();
        this.follows = source.readInt();
        this.fans = source.readInt();
        this.likes = source.readInt();
        this.followed = source.readByte() != 0;
    }

    public BlogUserInfo() {
    }

    protected BlogUserInfo(Parcel in) {
        this.user_id = in.readLong();
        this.blogs = in.readInt();
        this.follows = in.readInt();
        this.fans = in.readInt();
        this.likes = in.readInt();
        this.followed = in.readByte() != 0;
    }

    public static final Creator<BlogUserInfo> CREATOR = new Creator<BlogUserInfo>() {
        @Override
        public BlogUserInfo createFromParcel(Parcel source) {
            return new BlogUserInfo(source);
        }

        @Override
        public BlogUserInfo[] newArray(int size) {
            return new BlogUserInfo[size];
        }
    };
}
